package com.timoon.sample.dao;

import java.util.List;

import javax.annotation.PostConstruct;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.timoon.sample.dao.model.PassageComment;
import com.timoon.sample.dao.model.PassageCommentExample;

@Repository
public class PassageCommentDAOImpl extends SqlMapClientDaoSupport implements PassageCommentDAO {
	@javax.annotation.Resource(name="sqlMapClient")
	private SqlMapClient sqlMapClient;
	
	@PostConstruct
	public void addSqlMapClient() {
		// TODO Auto-generated constructor stub
		this.setSqlMapClient(sqlMapClient);
	}
	/**
	 * This method was generated by Abator for iBATIS. This method corresponds to the database table passage_comment
	 * @abatorgenerated  Sat Jun 08 16:09:35 CST 2013
	 */
	public PassageCommentDAOImpl() {
		super();
	}

	/**
	 * This method was generated by Abator for iBATIS. This method corresponds to the database table passage_comment
	 * @abatorgenerated  Sat Jun 08 16:09:35 CST 2013
	 */
	public void insert(PassageComment record) {
		getSqlMapClientTemplate().insert(
				"passage_comment.abatorgenerated_insert", record);
	}

	/**
	 * This method was generated by Abator for iBATIS. This method corresponds to the database table passage_comment
	 * @abatorgenerated  Sat Jun 08 16:09:35 CST 2013
	 */
	public int updateByPrimaryKeyWithoutBLOBs(PassageComment record) {
		int rows = getSqlMapClientTemplate().update(
				"passage_comment.abatorgenerated_updateByPrimaryKey", record);
		return rows;
	}

	/**
	 * This method was generated by Abator for iBATIS. This method corresponds to the database table passage_comment
	 * @abatorgenerated  Sat Jun 08 16:09:35 CST 2013
	 */
	public int updateByPrimaryKeyWithBLOBs(PassageComment record) {
		int rows = getSqlMapClientTemplate().update(
				"passage_comment.abatorgenerated_updateByPrimaryKeyWithBLOBs",
				record);
		return rows;
	}

	/**
	 * This method was generated by Abator for iBATIS. This method corresponds to the database table passage_comment
	 * @abatorgenerated  Sat Jun 08 16:09:35 CST 2013
	 */
	public int updateByPrimaryKeySelective(PassageComment record) {
		int rows = getSqlMapClientTemplate().update(
				"passage_comment.abatorgenerated_updateByPrimaryKeySelective",
				record);
		return rows;
	}

	/**
	 * This method was generated by Abator for iBATIS. This method corresponds to the database table passage_comment
	 * @abatorgenerated  Sat Jun 08 16:09:35 CST 2013
	 */
	public List selectByExampleWithoutBLOBs(PassageCommentExample example) {
		List list = getSqlMapClientTemplate().queryForList(
				"passage_comment.abatorgenerated_selectByExample", example);
		return list;
	}

	/**
	 * This method was generated by Abator for iBATIS. This method corresponds to the database table passage_comment
	 * @abatorgenerated  Sat Jun 08 16:09:35 CST 2013
	 */
	public List selectByExampleWithBLOBs(PassageCommentExample example) {
		List list = getSqlMapClientTemplate().queryForList(
				"passage_comment.abatorgenerated_selectByExampleWithBLOBs",
				example);
		return list;
	}

	/**
	 * This method was generated by Abator for iBATIS. This method corresponds to the database table passage_comment
	 * @abatorgenerated  Sat Jun 08 16:09:35 CST 2013
	 */
	public PassageComment selectByPrimaryKey(Integer id) {
		PassageComment key = new PassageComment();
		key.setId(id);
		PassageComment record = (PassageComment) getSqlMapClientTemplate()
				.queryForObject(
						"passage_comment.abatorgenerated_selectByPrimaryKey",
						key);
		return record;
	}

	/**
	 * This method was generated by Abator for iBATIS. This method corresponds to the database table passage_comment
	 * @abatorgenerated  Sat Jun 08 16:09:35 CST 2013
	 */
	public int deleteByExample(PassageCommentExample example) {
		int rows = getSqlMapClientTemplate().delete(
				"passage_comment.abatorgenerated_deleteByExample", example);
		return rows;
	}

	/**
	 * This method was generated by Abator for iBATIS. This method corresponds to the database table passage_comment
	 * @abatorgenerated  Sat Jun 08 16:09:35 CST 2013
	 */
	public int deleteByPrimaryKey(Integer id) {
		PassageComment key = new PassageComment();
		key.setId(id);
		int rows = getSqlMapClientTemplate().delete(
				"passage_comment.abatorgenerated_deleteByPrimaryKey", key);
		return rows;
	}

	/**
	 * This method was generated by Abator for iBATIS. This method corresponds to the database table passage_comment
	 * @abatorgenerated  Sat Jun 08 16:09:35 CST 2013
	 */
	public int countByExample(PassageCommentExample example) {
		Integer count = (Integer) getSqlMapClientTemplate().queryForObject(
				"passage_comment.abatorgenerated_countByExample", example);
		return count.intValue();
	}

	/**
	 * This method was generated by Abator for iBATIS. This method corresponds to the database table passage_comment
	 * @abatorgenerated  Sat Jun 08 16:09:35 CST 2013
	 */
	public int updateByExampleSelective(PassageComment record,
			PassageCommentExample example) {
		UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
		int rows = getSqlMapClientTemplate().update(
				"passage_comment.abatorgenerated_updateByExampleSelective",
				parms);
		return rows;
	}

	/**
	 * This method was generated by Abator for iBATIS. This method corresponds to the database table passage_comment
	 * @abatorgenerated  Sat Jun 08 16:09:35 CST 2013
	 */
	public int updateByExampleWithBLOBs(PassageComment record,
			PassageCommentExample example) {
		UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
		int rows = getSqlMapClientTemplate().update(
				"passage_comment.abatorgenerated_updateByExampleWithBLOBs",
				parms);
		return rows;
	}

	/**
	 * This method was generated by Abator for iBATIS. This method corresponds to the database table passage_comment
	 * @abatorgenerated  Sat Jun 08 16:09:35 CST 2013
	 */
	public int updateByExampleWithoutBLOBs(PassageComment record,
			PassageCommentExample example) {
		UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
		int rows = getSqlMapClientTemplate().update(
				"passage_comment.abatorgenerated_updateByExample", parms);
		return rows;
	}

	/**
	 * This class was generated by Abator for iBATIS. This class corresponds to the database table passage_comment
	 * @abatorgenerated  Sat Jun 08 16:09:35 CST 2013
	 */
	private static class UpdateByExampleParms extends PassageCommentExample {
		private Object record;

		public UpdateByExampleParms(Object record, PassageCommentExample example) {
			super(example);
			this.record = record;
		}

		public Object getRecord() {
			return record;
		}
	}
}